home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!news
- From: swampwiz@ix.netcom.com(Jean P. Laborde )
- Newsgroups: comp.lang.c++
- Subject: Re: unsigned char question
- Date: 9 Mar 1996 19:03:29 GMT
- Organization: Netcom
- Message-ID: <4hskm1$ss6@dfw-ixnews2.ix.netcom.com>
- References: <3136864B.7154@eds.com>
- NNTP-Posting-Host: nor-la1-15.ix.netcom.com
- X-NETCOM-Date: Sat Mar 09 1:03:29 PM CST 1996
-
- In <3136864B.7154@eds.com> Perry Hoekstra <lnusmsc.phoeks01@eds.com>
- writes:
- >
- >This is a basic question but one I cannot answer. I am using VC++ 2.0
- >and I wish to assign a string to a variable of type UCHAR * (which is
- an unsigned char
- >within ODBC). The code is as follows
- >
- >UCHAR * server;
- >
- >server = "jmbademo";
- >
-
- You have just defined a temporary string, to which you had 'server'
- point. After the ';', the temporary string was destroyed, so now
- 'server' is undefined. Try this:
-
- UCHAR server[] = "jmbademo"; // or something like this
-
- You now have an array of UCHAR's which will exist for the duration of
- its scope (unless you do something foolish to delete it)
-
- Comments Encouraged,
- The Swamp Wizard
-
-